package com.honghu.villagepost.dao.data.database;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by WuYiMing on 2017/1/4.
 */

public class DatabaseRegistry {

    private static List<DatabaseUpgrade> mUpgrades = new ArrayList<>();

    public static void registerUpgrade(DatabaseUpgrade... upgrades) {
        for (DatabaseUpgrade upgrade : upgrades) {
            registerUpgrade(upgrade);
        }
    }

    private static void registerUpgrade(DatabaseUpgrade upgrade) {
        if (!mUpgrades.contains(upgrade)) {
            mUpgrades.add(upgrade);
        }
    }

    public static List<DatabaseUpgrade> getUpgrades() {
        return mUpgrades;
    }
}
